import { UserInterface } from '@renderer/types'
import { defineStore } from 'pinia'

interface useUserInfoStoreInterface {
  userInfo: UserInterface | null
}

export const useUserInfoStore = defineStore('useUserInfoStore', {
  state: (): useUserInfoStoreInterface => {
    return {
      userInfo: null
    }
  },
  getters: {
    getUserInfo: (state) => state.userInfo
  },
  actions: {
    setUserInfo(userInfo: UserInterface) {
      this.userInfo = userInfo
    }
  }
})
